#ifndef IP6_IMPL_H
#define IP6_IMPL_H

#include <string.h>

#include "base_ip.h"
#include "common_defs.h"

#define MIN_IP6_HDR_SIZE    40

namespace usnet {
class IP6Impl : public BaseIP {
public:
    virtual ~IP6Impl() = default;

    static std::unique_ptr<IP6Impl>
    MakeUnique(const PPT proto, EndpointAddr* laddr, EndpointAddr* raddr);
    
    std::shared_ptr<FrameBufMgr> PrefillHeader() override;
    
    void SendPacket() override;
    
    bool RecvPacket() override;

    uint32_t GetHeaderSize() const override;

    uint16_t CheckSum(const FrameBuf* fb) override;

private:
    IP6Impl(const PPT proto, EndpointAddr* laddr, EndpointAddr* raddr)
        :BaseIP(proto, laddr, raddr)
    {
        // nothing to do
    }

    uint32_t hdr_size_ { MIN_IP6_HDR_SIZE };
};
} // end of namespace usnet
#endif